package at.fhhagenberg.mcm09.elevator.control;

import java.util.Queue;

import at.fhhagenberg.mcm09.elevator.model.StopRequest;

/**
 * Simple algorithm just uses the next floor as target floor and 
 * ignores any intelligent elevator routing. E.G. if elevator is in 3rd floor, has
 * one call to 7th floor and one to 2nd floor (in that sequence), simple algorithm
 * will give "floor 7" as result, even if "floor 2" would be the more economic method.
 * In other words, no lookahead is employed
 */
public class SimpleAlgorithm implements IAlgorithm {

	@Override
	public int getTargetFloor(Queue<StopRequest> q, int curFloor) {
		return q.peek().getTargetFloor();
		//return q.poll().getTargetFloor();
	}

}
